/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityClass;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 *
 * @author Ben
 */
@Entity(name="pin")
public class PIN implements Serializable {
   
    @Id
    private Long PINid;
    
        private MPI mpi;

    @OneToMany(cascade={CascadeType.ALL}, mappedBy="pin")
    private Collection<mCase> mcases= new ArrayList<mCase>();
      
    public PIN(){}
    public void create(Long PINid){
        this.setId(PINid);
    }

    public Long getId() {
        return PINid;
    }

    public void setId(Long PINid) {
        this.PINid = PINid;
    }  
    
    @ManyToOne
    public MPI getMpi() {
        return mpi;
    }

    public void setMpi(MPI mpi) {
        this.mpi = mpi;
    }
    
    
}
